public class Main {
    public static void main(String[] args) {
        MyThreadPool pool = new MyThreadPool(5);
        for(int i = 0; i < 10; i++){
            int id = i;
            pool.submit(()->{
                System.out.println("执行任务"+id+Thread.currentThread().getName());
            });
//            pool.submit(new Runnable() {
//                @Override
//                public void run() {
//                    System.out.println("执行任务"+id+Thread.currentThread().getName());
//                }
//            });
        }
    }
}
